const { src, dest, parallel, series } = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const browserify = require('gulp-browserify');

function js() {
    return src('js/*.js')
    .pipe(babel({
        presets: [
            ['@babel/env',{
                "useBuiltIns": "usage",
                "corejs": 3
            }]
        ]
    }))
    .pipe(browserify())
    .pipe(uglify())
    .pipe(dest('output/js/'));
}

exports.default = series(parallel(js));
